Suppress the intentional UseRealFor constraint change against the 1.1.0 package baseline#340
Merged
Merged
Conversation
…e 1.1.0 package baseline
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Main's Pack preview step fails with CP0021 against the 1.1.0 package baseline: the recently merged testing-stack PR tightened
UseRealFor<TService, TImplementation>'sTServiceconstraint fromnotnulltoclass. The PublicAPI analyzers don't track generic constraints, so the PR build was green - APICompat at pack time caught it.The constraint change is kept and declared as an intentional divergence via
CompatibilitySuppressions.xml(same mechanism as the MySql per-TFM suppression), because:TImplementation : class, TServicealready made a non-referenceTServiceuninstantiable (a class cannot derive from a struct; interfaces satisfy theclassconstraint).notnullis not implementable with the lazy-factory design: AutoMocker'sUse<TService>(Func<AutoMocker, TService>)cannot be bound whenTServiceis merelynotnull- explicit type arguments fail with CS0452 against theclass-constrainedMock<TService>overload, and inference silently binds the wrong overload (registering the delegate itself as a service; test-verified). The alternative would regressUseRealForto eager creation, losing the lazy + auto-disposal semantics.The full analysis is preserved as a comment in the suppression file.
Verification
dotnet pack src/Vulthil.xUnit -c Releaseagainst the 1.1.0 baseline: green (previously CP0021 x4).tests/Vulthil.SharedKernel.Tests(incl. the UseRealFor auto-disposal and dependency-visibility tests): 36/36 passing, both TFMs.notnullvariant compiles but binds the wrong overload (2 test failures); explicit type arguments fail with CS0452.Backport to v1.0: no - repairs the main-line package baseline only.